within ThreeD_MBS_Dynamics.Examples.Snakeboard;

model SemiBar
  extends RigidBodyEnergized;
  parameter SI.Acceleration[3] Gravity;
  parameter SI.Length LD;
  parameter SI.Length WD;
  parameter SI.Radius HD;
  VisualShape Bar(
    r0={-LD/2,0,0},
    Shape="box",
    LengthDirection={1,0,0},
    WidthDirection={0,0,1},
    Length=LD,
    Width=WD,
    Height=HD,
    Material={0,0.7,0.7,0.5});
  WrenchPort InPortJointA annotation (extent=[-60, 80; -40, 100]);
  annotation (Diagram);
equation
  Bar.S = T;
  Bar.r = r;
  F = m*Gravity + InPortJointA.F;
  M = InPortJointA.M + cross(InPortJointA.P - r, InPortJointA.F);
end SemiBar;
